﻿<UserControl x:Class="SoftSource.Timecard.Views.EntrySummaryView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             d:DesignWidth="124"
             d:DesignHeight="119.5">

    <UserControl.Resources>
        <Color x:Key="Red">#FF620000</Color>
        <Color x:Key="Blue">#FF003A62</Color>
        <Color x:Key="Green">#FF226200</Color>
        <Color x:Key="Orange">#FFA36000</Color>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot"
          DataContext="{Binding EntrySummary, Mode=OneWay}">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ColorStates">
                <VisualState x:Name="RedState">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="Background"
                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="{StaticResource Red}" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="BlueState">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="Background"
                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="{StaticResource Blue}" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="GreenState">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="Background"
                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="{StaticResource Green}" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="OrangeState">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                      Duration="00:00:00.0010000"
                                                      Storyboard.TargetName="Background"
                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                            <EasingColorKeyFrame KeyTime="00:00:00"
                                                 Value="{StaticResource Orange}" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid>
            <Rectangle x:Name="Background"
                       ToolTipService.ToolTip="{Binding Value.Hours, Mode=OneWay}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource Red}" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
        <Path Stretch="Fill"
              VerticalAlignment="Top"
              UseLayoutRounding="False"
              Data="M0,0 L85.464989,0 L85.464989,43.306221 L85.287735,43.08905 C66.346596,20.478907 36.240456,4.4516697 1.3489685,0.15222454 z">
            <Path.OpacityMask>
                <LinearGradientBrush EndPoint="0.601,0.568"
                                     StartPoint="0.994,0.006">
                    <GradientStop Color="Black"
                                  Offset="0" />
                    <GradientStop Color="Transparent"
                                  Offset="1" />
                </LinearGradientBrush>
            </Path.OpacityMask>
            <Path.Fill>
                <RadialGradientBrush Center="0.998,0"
                                     GradientOrigin="0.998,0"
                                     RadiusX="1.102"
                                     RadiusY="1.057">
                    <GradientStop Color="Transparent"
                                  Offset="1" />
                    <GradientStop Color="#7EFFFFFF" />
                </RadialGradientBrush>
            </Path.Fill>
        </Path>
    </Grid>
</UserControl>